package cn.com.easttech.gofishing.util;

import android.graphics.Bitmap.Config;
import android.util.Log;
import android.widget.ImageView;

public class ImageLoader {
    private static ImageHandle sImageHandle;

    public ImageLoader() {
    }

    public static void setImageHandle(ImageHandle imageHandle) {
        sImageHandle = imageHandle;
    }

    public static void showImage(String imageUrl, ImageView imageView) {
        if(sImageHandle != null) {
            Log.d("ImageLoader", "showImage---" + imageUrl);
            sImageHandle.showImage(imageUrl, imageView);
        }

    }

    public static void showImage(String imageUrl, ImageView imageView, int defaultImage) {
        if(sImageHandle != null) {
            sImageHandle.showImage(imageUrl, imageView, defaultImage);
        }

    }

    public static void showImage(String imageUrl, ImageView imageView, int width, int height, int defaultImage) {
        if(sImageHandle != null) {
            sImageHandle.showImage(imageUrl, imageView, width, height, defaultImage);
        }

    }

    public static void showImage(String imageUrl, ImageView imageView, Config bitmapConfig) {
        if(sImageHandle != null) {
            sImageHandle.showImage(imageUrl, imageView, bitmapConfig);
        }

    }

    public static void showImage(String imageUrl, ImageLoadingListener listener) {
        if(sImageHandle != null) {
            sImageHandle.showImage(imageUrl, listener);
        }

    }

    public static void showImage(String imageUrl, ImageView imageView, ImageLoadingListener listener) {
        if(sImageHandle != null) {
            sImageHandle.showImage(imageUrl, imageView, listener);
        }

    }
}
